/*
 * @Author: hcluo
 * @Date: 2020-04-16 13:53:55
 * @LastEditors: hcluo
 * @LastEditTime: 2020-06-26 19:39:40
 */
module.exports = function(api) {
    const presets = ['react-app'];
    const plugins = [
        // ["@babel/plugin-proposal-decorators", { "legacy": true }],
        '@babel/plugin-syntax-dynamic-import',
        ['import', { libraryName: 'antd', style: 'css' }, 'antd'],
    ];
    if (api.env('development')) {
        plugins.push('react-hot-loader/babel');
    }
    return { presets, plugins };
};
